package com.lantosec.hmrp.modules.morality.entity;

import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.lantosec.hmrp.core.mvc.BaseEntity;
import com.lantosec.hmrp.modules.morality.vo.MoralityNoteSelfVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * <p>
 * 考评记录自评明细 实体类
 * </p>
 *
 * @author AutoCode
 * @since 2020-04-20
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class MoralityNoteSelf extends BaseEntity<MoralityNoteSelfVO> {

    private static final long serialVersionUID = 1L;
    public MoralityNoteSelf(MoralityNoteSelfVO vo){
        this.noteSelfId = vo.getNoteSelfId();
        this.moralityPlanId = vo.getMoralityPlanId();
        this.moralityNoteId = vo.getMoralityNoteId();
        this.moralityTargetId = vo.getMoralityTargetId();
        this.moralityItemId = vo.getMoralityItemId();
        this.itemSelfScore = vo.getItemSelfScore();
    }

    @Override
    public MoralityNoteSelfVO convertToVO(){
        return new MoralityNoteSelfVO(this);
    }


    /**
     * 自评明细ID
     */
    @TableId(value = "note_self_id", type = IdType.AUTO)
    private Integer noteSelfId;

    /**
     * 考评方案ID
     */
    private Integer moralityPlanId;

    /**
     * 考评记录ID
     */
    private Integer moralityNoteId;

    /**
     * 被考评人ID
     */
    private String moralityTargetId;

    /**
     * 考评项目ID
     */
    private String moralityItemId;

    /**
     * 项目自评分
     */
    private BigDecimal itemSelfScore;


    public enum ColName {
        note_self_id, morality_note_id, morality_target_id, morality_item_id, item_self_score,
    }
}
